import { reactive } from './reactive.js';
import { effect } from './effect.js';
import { computed } from './computed.js';
import {watch,watchEffect} from './watch.js';
import { ref } from './ref.js';
const state = reactive({
  a: 1,
  b: 2,
  c:{
    s:'xx',
    sd:'aaa'
  }
});
let time = null;
let stop = watchEffect((onInvalidate)=>{
   time = setTimeout(()=>{
    console.log(state.a);
   },100)
   onInvalidate(()=>{
        clearInterval(time)
   })
})
// stop();
state.a++;
state.a++;
state.a++;
const resf = ref('xxx');

// // watchEffect
// // watch
 
// watch(resf.value,(e,a)=>{
//    console.log('watch',e,a)
// },{immediate:false,deep:false})
// resf.value=13;
// watch(()=>state.a,(e,a)=>{
//   console.log('watch',e,a)
// },{immediate:false,deep:true})
// state.a='asdasd';
// state.a='xx';
